package com.xiaofeinode.utils;

import cn.hutool.json.JSONUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class RespResultUtil {
    public static void write(ResultUtils result, HttpServletResponse response) throws IOException {

        String jsonStr = JSONUtil.toJsonStr(result);
        PrintWriter writer = response.getWriter();
        writer.print(jsonStr);
        writer.close();
    }
}
